/***************************************************
> Copyright (C) 2024 ==KINGYI== All rights reserved.
> File Name: 8.3.c
> Author:
> Mail: 
> Created Time: Fri 02 Aug 2024 08:25:09 PM PDT
***************************************************/

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
int main(int argc,const char* argv[])
{

	time_t tm=time(NULL);
	struct tm *p = localtime(&tm);
	pid_t pid = 0;
	int i = 0;
	pid = fork();
	if(pid==0)
	{
		while(i < 5)
		{
			printf("child procee:%s\n",asctime(p));
			sleep(1);
			i=i+1;
		}
		exit(0);
	}

	else if(pid > 0)
	{
		while(i < 5)
		{
			printf("father procee:%s\n",asctime(p));
			sleep(1);
			i = i+1;
		}
	}
	return 0;
}
